import { inject } from "vue";
import { storeKey } from "./constant";
import Store from "./Store";

// useStore作为hooks在组件中使用，内部可以使用vue3的hook函数
export const useStore = (injectKey = storeKey) => {
  return inject(injectKey);
};

export const createStore = (options) => {
  return new Store(options);
};
